<div class="zs-body" data-ng-init="formInit('gzpublishfile', {
        keyField:'id',
        randomFields:['id'],
        orderObject:{cjsj:1,jjdj:1}
    }) && loadData('gzpublishfile');setConHei();">
	<div class="zs-map-tool">
		<div class="location">
			<a href="javascript:;">首页</a>
			<i class="right-arr"></i>
			<a href="javascript:;">行政管理</a>
			<i class="right-arr"></i>
			<a href="javascript:;">发文管理</a>
		</div>
		<div class="option">
			<!--科室内部发文-->
			<input type="button" class="zs-btn orange" value="科室内部发文" 
				ng-show="mi.sa || mi.xzgl_gwgl_fwgl_ksnbfw" ng-click="startNewBpm('gzpublishfile.html','sfwgl_kszysj','gzpublishfile');" />
				
			<!--科员、科级干部、办公室科员发文-->
			<input type="button" class="zs-btn orange" value="申请发文" ng-show="mi.sa || mi.xzgl_gwgl_fwgl_kykz" ng-click="startNewBpm('gzpublishfile.html','sfwgl','gzpublishfile');" />
			<!--办公室主任、副局发文-->
			<input type="button" class="zs-btn orange" value="申请发文" ng-show="mi.sa || mi.xzgl_gwgl_fwgl_bgszrfj" ng-click="startNewBpm('gzpublishfile.html','sfwgl_zrjbgb','gzpublishfile');" />
			<!--局长发文-->
			<input type="button" class="zs-btn orange" value="免签批发文" ng-show="mi.sa || mi.xzgl_gwgl_fwgl_jz" ng-click="startNewBpm('gzpublishfile.html','sfwgl_jzgb','gzpublishfile');" />
			<!--<input type="button" class="zs-btn orange" value="编辑" 
                ng-click="editRow('gzpublishfile', gzpublishfile.sRows[0]) && openWindow('edit')"/>
            <input type="button" class="zs-btn orange" value="删除 "
                ng-click="delEntitys('gzpublishfile')"/>-->
		</div>
	</div>
	<div class="zs-content" style="position:unset">
		<div class="zs-nice-tab idTabs">
			<div class="tool item" style="margin-left:6px;">
				<!--<span class="search-warpper">
                    <i class="icon"></i>
                    <input type="text" class="zs-input" placeholder="ID" ng-model="gzpublishfile.queryObject['id']"/>
                </span>-->
				<span class="search-warpper">
					<i class="icon"></i>
					<input type="text" class="zs-input" placeholder="发文主题" ng-model="gzpublishfile.queryObject['fwzt:like']" />
				</span>
				<span class="search-warpper">
					<i class="icon"></i>
					<input type="text" class="zs-input" placeholder="来文摘要" ng-model="gzpublishfile.queryObject['fwsm:like']" />
				</span>
				
				<span class="search-warpper" style="width: 65px;">紧急等级
				</span>
				<span class="search-warpper" style="width: 175px;">
					<ag-Combobox style="width:175px;height:28px;"
                        para="{	uDictionary:true,
                        		editable:true,
                        		dictionary:'p_jjdj'}"
                        ng-model="gzpublishfile.queryObject['jjdj:=']"
                        text-Value="o"/>
				</span>
				<span class="search-warpper" style="width: 65px;">创建时间
				</span>
				<span class="search-warpper" style="width: 175px;">
					<ag-Datebox class="zs-input" style="width:175px;height: 28px" ng-model="gzpublishfile.queryObject['cjsj:>=']">
					</ag-Datebox>
				</span>-
				<span class="search-warpper" style="width: 175px;">
					<ag-Datebox class="zs-input" style="width:175px;height: 28px" ng-model="gzpublishfile.queryObject['cjsj:<=']">
					</ag-Datebox>
				</span>
			</div>
			<div class="operation item" style="margin-top:7px;">
				<input type="button" class="zs-btn orange" value="查询" ng-click="loadData('gzpublishfile')" />
			</div>
		</div>
		<div class="date-container">
			<div id="zpgwd">
				<div class="zs-data-table">
					<div class="container">
						<table>
							<thead>
								<tr>
									<th>
										<input id="allCheckbox" type="checkbox" ng-click="selectAll('gzpublishfile','allCheckbox');" />
									</th>
								
									<th>发文主题</th>
									<th>来文摘要</th>
									
									<th>创建人名称</th>
									<th>创建时间</th>
								
									<th>部门名称</th>
									<th>紧急等级</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<tr ng-repeat="r in gzpublishfile.datas">
									<td>
										<input type="checkbox" ng-click="selectRow('gzpublishfile',r);" ng-model="r.selected" />
									</td>
									<!--  ID -->
									<!--<td>
                                        <a ng-click="toQueryWork('ccgl.html','ccgl','gzccgl','gzccgl',r.id);">
                                            <label ng-bind="r.id"></label>
                                        </a>
                                   </td>-->
									<!--  发文主题 -->
									<td>
										<a ng-click="toQueryWork('gzpublishfile.html',r.bpmkey,'gzpublishfile','gzpublishfile',r.id);" title="{{r.fwzt}}">
											<label ng-bind="r.fwzt | asULength"></label>
										</a>
									</td>
									<!--  来文摘要 -->
									<td>
										<a ng-click="toQueryWork('gzpublishfile.html',r.bpmkey,'gzpublishfile','gzpublishfile',r.id);" title="{{r.fwsm}}">
											<label ng-bind="r.fwsm | asULength"></label>
										</a>
									</td>
									<!--  创建人ID -->
									<!--<td>
                                        <a ng-click="editRow('gzpublishfile',r) && openWindow('edit');">
                                            <label ng-bind="r.cjrid"></label>
                                        </a>
                                   </td>-->
									<!--  创建人名称 -->
									<td>
										<a ng-click="toQueryWork('gzpublishfile.html',r.bpmkey,'gzpublishfile','gzpublishfile',r.id);">
											<label ng-bind="r.cjrmc"></label>
										</a>
									</td>
									<!--  创建时间 -->
									<td>
										<a ng-click="toQueryWork('gzpublishfile.html',r.bpmkey,'gzpublishfile','gzpublishfile',r.id);">
											<label ng-bind="r.cjsj | asFormateDateTime | date:'yyyy-MM-dd'"></label>
										</a>
									</td>
									<!--  附件 -->
									<!--	<td>
                                        <a ng-click="editRow('gzpublishfile',r) && openWindow('edit');">
                                            <label ng-bind="r.fj"></label>
                                        </a>
                                   </td>-->
									<!--  部门ID -->
									<!--<td>
                                        <a ng-click="editRow('gzpublishfile',r) && openWindow('edit');">
                                            <label ng-bind="r.bmid"></label>
                                        </a>
                                   </td>-->
									<!--  部门名称 -->
									<td>
										<a ng-click="toQueryWork('gzpublishfile.html',r.bpmkey,'gzpublishfile','gzpublishfile',r.id);">
											<label ng-bind="r.bmmcName"></label>
										</a>
									</td>
									
									<td>
										<a ng-click="toQueryWork('gzpublishfile.html',r.bpmkey,'gzpublishfile','gzpublishfile',r.id);">
											<label ng-bind="r.jjdjName"></label>
										</a>
									</td>
									<td>
										<a ng-click="deleteJzbg(r)" ng-if="r.bpmkey == 'sfwgl_jzgb' && (r.cjrid == curUser.userid)" style="color: blue;cursor: pointer;">
											删除
										</a>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<div class="zs-pagination-box">
					<ag-Page fn='gzpublishfile'></ag-Page>
				</div>
			</div>
		</div>

		<div ag-Window id="edit" title="发文管理编辑" width='760px' height='560px'>
			<div class="zs-form-tab ibox">
				<form name="form" novalidate>
					<table width="100%">
						<tbody>

							<tr>
								<td class="text" width="20%">发文主题</td>
								<td class="left" width="30%" colspan="3">
									<textarea type="text" style="width:95%;height:100px" ng-model="gzpublishfile.editRow.fwzt" class="zs-input"></textarea>
								</td>

							</tr>
							<tr>
								<td class="text" width="20%">来文摘要</td>
								<td class="left" width="30%" colspan="3">
									<textarea type="text" style="width:95%;height:100px" ng-model="gzpublishfile.editRow.fwsm" class="zs-input" />
									</td>
                            </tr>
          					<tr>
                                <td class="text" width="20%">创建人名称</td>
                                <td class="left" width="30%">
                                	<!--<input type="text" ng-model="gzpublishfile.editRow.cjrmc" 
                                		class="zs-input" style="width:75%;"/>-->
                                		
                                	<ag-User ng-model="gzpublishfile.editRow.cjrid" 
                                		text-Value="gzpublishfile.editRow.cjrmc" id="cjrid"
                                		canuse="{{gzpublishfile.editRow.FIELD_ISNEW}}"></ag-User>
                                </td>
                                <td class="text" width="20%">创建时间</td>
                                <td class="left" width="30%">
							   		<ag-Date ng-model="gzpublishfile.editRow.cjsj" id="cjsj1"
							   			canuse="{{gzpublishfile.editRow.FIELD_ISNEW}}"></ag-Date>
                                </td>
                            </tr>
          					<tr>
          						<td class="text" width="20%">部门名称</td>
                                <td class="left" width="30%">
                                	 <ag-Dep ng-model="gzpublishfile.editRow.bmmc" text-Value="gzpublishfile.editRow.bmmcName"  id="bmmc"
				                   	canuse="{{gzpublishfile.editRow.FIELD_ISNEW}}"></ag-Dep>
                                </td>
                                <td class="text" width="20%">附件</td>
                                <td class="left" width="30%">
				                    	<ag-Upload ng-model="gzpublishfile.editRow.fj" para="{}"></ag-Upload>
                                </td>
                            </tr>
                        </tbody>
                        <table width="100%">
							<tr>
								<td colspan="3"  class="left">
									<span>收件人</span><span style="float: right;">
									<input type="button" class="zs-btn"
									ng-click="openWindow('chooseUser')"
									value="添加" /> <input type="button" class="zs-btn"
									ng-click="delLocalRows(gzpublishfile.editRow.gzreceivefile)"
									value="删除"></span>
								</td>
							</tr>
							<tr>
								<td style="text-align: center" class="text" width="5%">
								<input id="allCheckbox12" type="checkbox"
                                        ng-click="selectAll('gzpublishfile.editRow.gzreceivefile','allCheckbox12');" /></td>
								<td width="40%" class="text" style="text-align: center">收件人名称</td>
								<td width="40%" class="text" style="text-align: center">部门</td>
							</tr>
							<tr
								ng-repeat="r in gzpublishfile.editRow.gzreceivefile">
								<td class="center">
									<input type="checkbox"
                                        ng-click="selectRow('gzpublishfile.editRow.gzreceivefile',r);"
                                        ng-model="r.selected" /></td>
								<td><span>
										<!--<input type="text" style="width: 95%"
										class="zs-input" ng-model="r.jsrmc" /></td>-->
										
										<label ng-bind="r.jsrmc"></label>
								<td><span>
										<!--<input type="text" style="width: 95%"
										class="zs-input" ng-model="r.jsrjg" />-->
										
										<label ng-bind="r.jsrjgmc"></label>
								</td>
							</tr>
						</table>
                        <tfoot>
                            <tr>
                                <td colspan="4">
                                	<div style="text-align:center">
	                                    <input type="button" name="ok" value="保存" class="zs-btn c-red"
	                                        ng-click="formValidate(form) && setUser('gzpublishfile','cyrid','cjrmc') && save('gzpublishfile', gzpublishfile.editRow, closeWindow('edit'))"/>
	                                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
	                                        ng-click="closeWindow('edit')" />
                                    </div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </form>
            </div>
        </div>
        
        <div ag-Window id="chooseUser" title="选择收件人" width='560px' height='360px'>
		    <div class="zs-form-tab ibox"
		    	data-ng-init="formInit('userinfo', {
					ssn:'vuserinfo',
					esn:'userinfo',
					keyField:'userid',
					randomFields:['userid'],
					orderObject:{userid:0} 
				}) && loadData('userinfo');setConHei();">
		        <div class="zs-nice-tab idTabs">
					<div class="tool item" style="margin-left:6px;">
		            	<span class="search-warpper">
			    			<i class="icon"></i>
				    		<input type="text" placeholder="姓名" class="zs-input" ng-model="userinfo.queryObject['userName:like']"/>
			    		</span>
			    		<span class="search-warpper">
			    			<i class="icon"></i>
				    		<ag-Combobox class="zs-input" style="width:175px;height: 28px" 
								fn='dptidEdit'
								para="{ uDictionary:true,
										dictionary:'p_department',
										pidField:'pid',
                						leafField:'leaf'}"
								ng-model="userinfo.queryObject['departmentId:=']"/>
			    		</span>
		            </div>
		            <div class="operation item" style="margin-top:5px;margin-left:0px;">
		            	<input type="button" class="zs-btn orange" value="查询" 
		            		ng-click="loadData('userinfo')"/>
		                <!--<a class="ope-1" ng-click="loadData('userinfo')"></a>
		                <a class="ope-2"></a>-->
		            </div>
		          
		        </div>
		        <div class="date-container">
		            <div id="zpgwd">
		                <div class="zs-data-table">
		                    <div class="container">
		                        <table>
		                            <thead>
		                                <tr>
		                                	<th>
		                                        <input id="allCheckbox" type="checkbox"
		                                            ng-click="selectAll('userinfo','allCheckbox');" />
		                                    </th>
											<th>姓名/帐号</th>
					                        <th>所属机构</th>
					                        <th>所属角色</th>
		                                </tr>
		                            </thead>
		                            <tbody>
		                                <tr ng-repeat="r in userinfo.datas">
		                                	<td>
		                                        <input type="checkbox"
		                                            ng-click="selectRow('userinfo',r);"
		                                            ng-model="r.selected" />
		                                    </td>
							                <td>
							                    <a>
							                        <label ng-bind="r.userName"></label>
							                        <label ng-if="r.accounts">/</label>
							                        <label ng-bind="r.accounts"></label>
							                    </a>
							                </td>
							                <td>
							                    <a>
							                        <label ng-bind="r.organizationName"></label>
							                        <label ng-bind="r.departmentName"></label>
							                        <label ng-bind="r.operatingPostName"></label>
							                    </a>
							                </td>
							                <td>
							                    <a>
							                        <label ng-bind="r.roleNames"></label>
							                    </a>
							                </td>
							            </tr>
		                            </tbody>
		                        </table>
		                    </div>
		                </div>
		                <div class="zs-pagination-box">
		                    <ag-Page fn='userinfo'></ag-Page>
		                </div>
		                
		                <div style="text-align: center;">
			                <input type="button" class="zs-btn orange" value="选择 "
	                			ng-click="chooseSJR('gzpublishfile','gzreceivefile','userinfo','chooseUser')"/>
			            </div>
		            </div>
		        </div>
		    </div>
		</div>
    </div>
</div>